package dd.control;


import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.JTextField;

import dd.model.Event;
import dd.model.Model;
import dd.view.AddEdgesFrame;
import dd.view.SetChoicesForClosedEvent;

public class CloseEventSubmitChoiceButtonController implements ActionListener{

	
	SetChoicesForClosedEvent form;
	public CloseEventSubmitChoiceButtonController(SetChoicesForClosedEvent f){
		this.form = f;
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		Model model = Model.getInstance();
		Event event = model.getEvent();
		ArrayList<JTextField> Choices = form.getChoices();
		for(int i = 0; i<event.getNumberLines();i++){
		event.setChoices(i,(String) Choices.get(i).getText());
		System.out.println(event.getChoice(i));
		AddEdgesFrame aef = new AddEdgesFrame();
		aef.setVisible(true);
		form.dispose();
		}
	}

}
